package top.kaoshanji.p3ch12a;

/**
 * 代码清单-p3ch12a-382页a：形式类型参数的上界
 * author kaoshanji
 * ^_^
 * create time 2025/2/6 11:10
 */
public class ComparableObjectHolder<T extends Comparable<T>> {

    private T obj;

    public int compareTo(T anotherObj) {
        return obj.compareTo(anotherObj);
    }

    public void test() {
        ComparableObjectHolder<String> holder = new ComparableObjectHolder<>();
    }

}
